<template>
  <button
    class="copy-button"
    style="--button-bg: #c8c8c8; width: fit-content; padding: 0.5em 1em;"
    :class="{ 'active:bg-blue-50': true }"
    @click="$emit('click')"
  >
    <span v-if="icon" class="mr-1 font-bold">←</span>
    <span>{{ text }}</span>
  </button>
</template>

<script setup>
defineProps({
  icon: {
    type: Boolean,
    default: true
  },
  text: {
    type: String,
    default: '返回'
  }
})

defineEmits(['click'])
</script>
